﻿using UsedBookTradeSystem.Models.Base;
using UsedBookTradeSystem.Models.Enum;

namespace UsedBookTradeSystem.Models.Entity
{
    public class Order:BaseEntity
    {
        public int Id { get; set; }
        public List<Book> BookList { get; set; }

        public double Total { 
            get 
            {
                return Math.Round(BookList.Sum(x => (double)x.Price),2);
            } 
        }

        public OrderEnum OrderStatus { get; set; }

        public string? Address { get; set; }

        public string? UserName { get; set; }
        public string? Tel { get; set; }
        public User? User { get; set; }
    }
}
